home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / scale.z / scale
Text File  |  1998-10-30  |  20KB  |  397 lines

  1.  
  2.  
  3.  
  4. ssssccccaaaalllleeee((((3333TTTTkkkk))))                                                          ssssccccaaaalllleeee((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      scale - Create and manipulate scale widgets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ssssccccaaaalllleeee _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  13.  
  14. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  15.      aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  ffffoooonnnntttt                 hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss  rrrreeeeppppeeeeaaaattttIIIInnnntttteeeerrrrvvvvaaaallll|
  16.      bbbbaaaacccckkkkggggrrrroooouuuunnnndddd        ffffoooorrrreeeeggggrrrroooouuuunnnndddd           oooorrrriiiieeeennnntttt              ttttaaaakkkkeeeeFFFFooooccccuuuussss     |
  17.      bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh       hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  rrrreeeelllliiiieeeeffff              ttttrrrroooouuuugggghhhhCCCCoooolllloooorrrr   |
  18.      ccccuuuurrrrssssoooorrrr            hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr       rrrreeeeppppeeeeaaaattttDDDDeeeellllaaaayyyy
  19.  
  20.      See the ``options'' manual entry for details on the standard options.
  21.  
  22. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  23.      Name:           bbbbiiiiggggIIIInnnnccccrrrreeeemmmmeeeennnntttt
  24.      Class:          BBBBiiiiggggIIIInnnnccccrrrreeeemmmmeeeennnntttt
  25.      Command-Line Switch:----bbbbiiiiggggiiiinnnnccccrrrreeeemmmmeeeennnntttt
  26.  
  27.           Some interactions with the scale cause its value to change by       |
  28.           ``large'' increments;  this option specifies the size of the large  |
  29.           increments.  If specified as 0, the large increments default to 1/10|
  30.           the range of the scale.
  31.  
  32.      Name:           ccccoooommmmmmmmaaaannnndddd
  33.      Class:          CCCCoooommmmmmmmaaaannnndddd
  34.      Command-Line Switch:----ccccoooommmmmmmmaaaannnndddd
  35.  
  36.           Specifies the prefix of a Tcl command to invoke whenever the scale's|
  37.           value is changed via a widget command.  The actual command consists
  38.           of this option followed by a space and a real number indicating the
  39.           new value of the scale.
  40.  
  41.      Name:           ddddiiiiggggiiiittttssss
  42.      Class:          DDDDiiiiggggiiiittttssss
  43.      Command-Line Switch:----ddddiiiiggggiiiittttssss
  44.  
  45.           An integer specifying how many significant digits should be retained|
  46.           when converting the value of the scale to a string.  If the number  |
  47.           is less than or equal to zero, then the scale picks the smallest    |
  48.           value that guarantees that every possible slider position prints as |
  49.           a different string.
  50.  
  51.      Name:           ffffrrrroooommmm
  52.      Class:          FFFFrrrroooommmm
  53.      Command-Line Switch:----ffffrrrroooommmm
  54.  
  55.           A real value corresponding to the left or top end of the scale.
  56.  
  57.      Name:           llllaaaabbbbeeeellll
  58.      Class:          LLLLaaaabbbbeeeellll
  59.      Command-Line Switch:----llllaaaabbbbeeeellll
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssccccaaaalllleeee((((3333TTTTkkkk))))                                                          ssssccccaaaalllleeee((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.           A string to display as a label for the scale.  For vertical scales
  75.           the label is displayed just to the right of the top end of the
  76.           scale.  For horizontal scales the label is displayed just above the
  77.           left end of the scale.  If the option is specified as an empty
  78.           string, no label is displayed.
  79.  
  80.      Name:           lllleeeennnnggggtttthhhh
  81.      Class:          LLLLeeeennnnggggtttthhhh
  82.      Command-Line Switch:----lllleeeennnnggggtttthhhh
  83.  
  84.           Specifies the desired long dimension of the scale in screen units
  85.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss).  For vertical
  86.           scales this is the scale's height;  for horizontal scales it is the
  87.           scale's width.
  88.  
  89.      Name:           rrrreeeessssoooolllluuuuttttiiiioooonnnn                                               |
  90.      Class:          RRRReeeessssoooolllluuuuttttiiiioooonnnn                                               |
  91.      Command-Line Switch:----rrrreeeessssoooolllluuuuttttiiiioooonnnn                                          |
  92.  
  93.           A real value specifying the resolution for the scale.  If this value|
  94.           is greater than zero then the scale's value will always be rounded  |
  95.           to an even multiple of this value, as will tick marks and the       |
  96.           endpoints of the scale.  If the value is less than zero then no     |
  97.           rounding occurs.  Defaults to 1 (i.e., the value will be integral).
  98.  
  99.      Name:           sssshhhhoooowwwwVVVVaaaalllluuuueeee
  100.      Class:          SSSShhhhoooowwwwVVVVaaaalllluuuueeee
  101.      Command-Line Switch:----sssshhhhoooowwwwvvvvaaaalllluuuueeee
  102.  
  103.           Specifies a boolean value indicating whether or not the current
  104.           value of the scale is to be displayed.
  105.  
  106.      Name:           sssslllliiiiddddeeeerrrrLLLLeeeennnnggggtttthhhh
  107.      Class:          SSSSlllliiiiddddeeeerrrrLLLLeeeennnnggggtttthhhh
  108.      Command-Line Switch:----sssslllliiiiddddeeeerrrrlllleeeennnnggggtttthhhh
  109.  
  110.           Specfies the size of the slider, measured in screen units along the
  111.           slider's long dimension.  The value may be specified in any of the
  112.           forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss.
  113.  
  114.      Name:           ssssttttaaaatttteeee
  115.      Class:          SSSSttttaaaatttteeee
  116.      Command-Line Switch:----ssssttttaaaatttteeee
  117.  
  118.           Specifies one of three states for the scale:  nnnnoooorrrrmmmmaaaallll, aaaaccccttttiiiivvvveeee, or    |
  119.           ddddiiiissssaaaabbbblllleeeedddd.  If the scale is disabled then the value may not be       |
  120.           changed and the scale won't activate.  If the scale is active, the  |
  121.           slider is displayed using the color specified by the                |
  122.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd option.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssccccaaaalllleeee((((3333TTTTkkkk))))                                                          ssssccccaaaalllleeee((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      Name:           ttttiiiicccckkkkIIIInnnntttteeeerrrrvvvvaaaallll
  141.      Class:          TTTTiiiicccckkkkIIIInnnntttteeeerrrrvvvvaaaallll
  142.      Command-Line Switch:----ttttiiiicccckkkkiiiinnnntttteeeerrrrvvvvaaaallll
  143.  
  144.           Must be a real value.  Determines the spacing between numerical tick
  145.           marks displayed below or to the left of the slider.  If 0, no tick
  146.           marks will be displayed.
  147.  
  148.      Name:           ttttoooo
  149.      Class:          TTTToooo
  150.      Command-Line Switch:----ttttoooo
  151.  
  152.           Specifies a real value corresponding to the right or bottom end of
  153.           the scale.  This value may be either less than or greater than the
  154.           ffffrrrroooommmm option.
  155.  
  156.      Name:           vvvvaaaarrrriiiiaaaabbbblllleeee
  157.      Class:          VVVVaaaarrrriiiiaaaabbbblllleeee
  158.      Command-Line Switch:----vvvvaaaarrrriiiiaaaabbbblllleeee
  159.  
  160.           Specifies the name of a global variable to link to the scale.
  161.           Whenever the value of the variable changes, the scale will upate to
  162.           reflect this value.  Whenever the scale is manipulated
  163.           interactively, the variable will be modified to reflect the scale's
  164.           new value.
  165.  
  166.      Name:           wwwwiiiiddddtttthhhh
  167.      Class:          WWWWiiiiddddtttthhhh
  168.      Command-Line Switch:----wwwwiiiiddddtttthhhh
  169.  
  170.           Specifies the desired narrow dimension of the trough in screen units
  171.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss).  For vertical
  172.           scales this is the trough's width;  for horizontal scales this is
  173.           the trough's height.
  174.  
  175.  
  176. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  177.      The ssssccccaaaalllleeee command creates a new window (given by the _p_a_t_h_N_a_m_e argument)
  178.      and makes it into a scale widget.  Additional options, described above,
  179.      may be specified on the command line or in the option database to
  180.      configure aspects of the scale such as its colors, orientation, and
  181.      relief.  The ssssccccaaaalllleeee command returns its _p_a_t_h_N_a_m_e argument.  At the time
  182.      this command is invoked, there must not exist a window named _p_a_t_h_N_a_m_e,
  183.      but _p_a_t_h_N_a_m_e's parent must exist.
  184.  
  185.      A scale is a widget that displays a rectangular _t_r_o_u_g_h and a small
  186.      _s_l_i_d_e_r.  The trough corresponds to a range of real values (determined by
  187.      the ffffrrrroooommmm, ttttoooo, and rrrreeeessssoooolllluuuuttttiiiioooonnnn options), and the position of the slider
  188.      selects a particular real value.  The slider's position (and hence the
  189.      scale's value) may be adjusted with the mouse or keyboard as described in|
  190.      the BINDINGS section below.  Whenever the scale's value is changed, a Tcl
  191.      command is invoked (using the ccccoooommmmmmmmaaaannnndddd option) to notify other interested
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ssssccccaaaalllleeee((((3333TTTTkkkk))))                                                          ssssccccaaaalllleeee((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206.      widgets of the change.  In addition, the value of the scale can be linked
  207.      to a Tcl variable (using the vvvvaaaarrrriiiiaaaabbbblllleeee option), so that changes in either
  208.      are reflected in the other.
  209.  
  210.      Three annotations may be displayed in a scale widget:  a label appearing
  211.      at the top right of the widget (top left for horizontal scales), a number
  212.      displayed just to the left of the slider (just above the slider for
  213.      horizontal scales), and a collection of numerical tick marks just to the
  214.      left of the current value (just below the trough for horizontal scales).
  215.      Each of these three annotations may be enabled or disabled using the
  216.      configuration options.
  217.  
  218.  
  219. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  220.      The ssssccccaaaalllleeee command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e.  This
  221.      command may be used to invoke various operations on the widget.  It has
  222.      the following general form:
  223.  
  224.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  225.  
  226.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command.  The
  227.      following commands are possible for scale widgets:
  228.  
  229.      _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n
  230.           Returns the current value of the configuration option given by      |
  231.           _o_p_t_i_o_n.  _O_p_t_i_o_n may have any of the values accepted by the ssssccccaaaalllleeee    |
  232.           command.
  233.  
  234.      _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  235.           Query or modify the configuration options of the widget.  If no
  236.           _o_p_t_i_o_n is specified, returns a list describing all of the available
  237.           options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the
  238.           format of this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  239.           the command returns a list describing the one named option (this
  240.           list will be identical to the corresponding sublist of the value
  241.           returned if no _o_p_t_i_o_n is specified).  If one or more _o_p_t_i_o_n-_v_a_l_u_e
  242.           pairs are specified, then the command modifies the given widget
  243.           option(s) to have the given value(s);  in this case the command
  244.           returns an empty string.  _O_p_t_i_o_n may have any of the values accepted
  245.           by the ssssccccaaaalllleeee command.
  246.  
  247.      _p_a_t_h_N_a_m_e ccccoooooooorrrrddddssss ?_v_a_l_u_e?
  248.           Returns a list whose elements are the x and y coordinates of the    |
  249.           point along the centerline of the trough that corresponds to _v_a_l_u_e. |
  250.           If _v_a_l_u_e is omitted then the scale's current value is used.
  251.  
  252.      _p_a_t_h_N_a_m_e ggggeeeetttt ?_x _y?
  253.           If _x and _y are omitted, returns the current value of the scale.  If |
  254.           _x and _y are specified, they give pixel coordinates within the       |
  255.           widget;  the command returns the scale value corresponding to the   |
  256.           given pixel.  Only one of _x or _y is used:  for horizontal scales _y  |
  257.           is ignored, and for vertical scales _x is ignored.
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ssssccccaaaalllleeee((((3333TTTTkkkk))))                                                          ssssccccaaaalllleeee((((3333TTTTkkkk))))
  269.  
  270.  
  271.  
  272.      _p_a_t_h_N_a_m_e iiiiddddeeeennnnttttiiiiffffyyyy _x _y
  273.           Returns a string indicating what part of the scale lies under the   |
  274.           coordinates given by _x and _y.  A return value of sssslllliiiiddddeeeerrrr means that  |
  275.           the point is over the slider;  ttttrrrroooouuuugggghhhh1111 means that the point is over |
  276.           the portion of the slider above  or to the left of the slider; and  |
  277.           ttttrrrroooouuuugggghhhh2222 means that the point is over the portion of the slider below|
  278.           or to the right of the slider.  If the point isn't over one of these|
  279.           elements, an empty string is returned.
  280.  
  281.      _p_a_t_h_N_a_m_e sssseeeetttt _v_a_l_u_e
  282.           This command is invoked to change the current value of the scale,
  283.           and hence the position at which the slider is displayed.  _V_a_l_u_e
  284.           gives the new value for the scale.  The command has no effect if the
  285.           scale is disabled.
  286.  
  287.  
  288. BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  289.      Tk automatically creates class bindings for scales that give them the
  290.      following default behavior.  Where the behavior is different for vertical
  291.      and horizontal scales, the horizontal behavior is described in
  292.      parentheses.
  293.  
  294.      [1]  If button 1 is pressed in the trough, the scale's value will be     |
  295.           incremented or decremented by the value of the rrrreeeessssoooolllluuuuttttiiiioooonnnn option so |
  296.           that the slider moves in the direction of the cursor. If the button |
  297.           is held down, the action auto-repeats.
  298.  
  299.      [2]  If button 1 is pressed over the slider, the slider can be dragged
  300.           with the mouse.
  301.  
  302.      [3]  If button 1 is pressed in the trough with the Control key down, the
  303.           slider moves all the way to the end of its range, in the direction
  304.           towards the mouse cursor.
  305.  
  306.      [4]  The Up and Left keys move the slider up (left) by the value of the
  307.           rrrreeeessssoooolllluuuuttttiiiioooonnnn option.
  308.  
  309.      [5]  The Down and Right keys move the slider down (right) by the value of
  310.           the rrrreeeessssoooolllluuuuttttiiiioooonnnn option.
  311.  
  312.      [6]  Control-Up and Control-Left move the slider up (left) by the value
  313.           of the bbbbiiiiggggIIIInnnnccccrrrreeeemmmmeeeennnntttt option.
  314.  
  315.      [7]  Control-Down and Control-Right move the slider down (right) by the
  316.           value of the bbbbiiiiggggIIIInnnnccccrrrreeeemmmmeeeennnntttt option.
  317.  
  318.      [8]  Home moves the slider to the top (left) end of its range.
  319.  
  320.      [9]  End moves the slider to the bottom (right) end of its range.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ssssccccaaaalllleeee((((3333TTTTkkkk))))                                                          ssssccccaaaalllleeee((((3333TTTTkkkk))))
  335.  
  336.  
  337.  
  338.      If the scale is disabled using the ssssttttaaaatttteeee option then none of the above
  339.      bindings have any effect.
  340.  
  341.      The behavior of scales can be changed by defining new bindings for
  342.      individual widgets or by redefining the class bindings.
  343.  
  344.  
  345. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  346.      scale, slider, trough, widget
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.